﻿Public Class frmPrototype
    Private _persona As New Persona
    Private _personaClonada As Persona

    Private Sub frmPrototype_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Output.Print("-------------------------")
        Output.Print("--Patrón Prototype:")

        txtNombre.DataBindings.Add("Text", _persona, "Nombre")
        txtApellido.DataBindings.Add("Text", _persona, "Apellido")
        txtDNI.DataBindings.Add("Text", _persona, "Dni")

    End Sub

    Private Sub btnClonar_Click(sender As System.Object, e As System.EventArgs) Handles btnClonar.Click

        txtNombreClon.DataBindings.Clear()
        txtApellidoClon.DataBindings.Clear()
        txtDNIClon.DataBindings.Clear()

        _personaClonada = _persona.Clonar()

        txtNombreClon.DataBindings.Add("Text", _personaClonada, "Nombre")
        txtApellidoClon.DataBindings.Add("Text", _personaClonada, "Apellido")
        txtDNIClon.DataBindings.Add("Text", _personaClonada, "Dni")

    End Sub

End Class